//
//  SchoolHeaderCollectionReusableView.m
//  Civacrm
//
//  Created by mubei on 17/2/24.
//  Copyright © 2017年 王桂敏. All rights reserved.
//

#import "SchoolHeaderCollectionReusableView.h"

@implementation SchoolHeaderCollectionReusableView
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView{
    
    self.showLable = [[UILabel alloc]init];
    self.showLable.backgroundColor = GlobalBlue;
    [self addSubview:self.showLable];

    self.titleLable = [[UILabel alloc] init];
    self.titleLable.font = font(22);
    self.titleLable.textColor = GlobalBlue;
    [self addSubview:self.titleLable ];
    
    self.button = [[UIButton alloc] init];
    [self addSubview: self.button];
    
    self.studentLable = [[UILabel alloc] init];
    self.studentLable.font = font(20);
    self.studentLable.textColor = ColorWithHexString(@"4e778f");
    [self.button addSubview:self.studentLable ];
    
    self.imageView = [[UIImageView alloc] init];
    [self.button addSubview:self.imageView];
}
- (void)layoutSubviews{
    [super layoutSubviews];
    
    self.showLable.frame = CGRectMake(w(20), h(19), w(5), h(20)) ;
    self.titleLable.frame = CGRectMake(getMaxX(self.showLable) + w(11), h(19), 0, 0);
    [self.titleLable sizeToFit];
    self.button.frame =CGRectMake(self.width - w(160), 0, w(160), h(62));
    self.studentLable.frame = CGRectMake(self.button.width - w(120), 0,0,0);
    [self.studentLable sizeToFit];
    self.studentLable.centerY = h(62)/2;
    self.imageView.frame = CGRectMake(getMaxX(self.studentLable) + w(12), 0, w(19), h(17));
    self.imageView.centerY = self.studentLable.centerY;
}
@end
